package com.itheima.day_02.homework02;

import java.util.ArrayList;
import java.util.Random;

public class Test02 {
    public static void main(String[] args) {
        String sc = "令狐冲, 风清扬,左冷禅,岳不群,苗人凤";
        String[] arr = sc.split(",");
        System.out.println("本班人员名单如下");
        int count = 0;
        for (int i = 0; i < arr.length; i++) {
            count++;
            if (count % 2 == 0) {
                System.out.println(arr[i]);
            }else{
            System.out.print(arr[i]+"  ");
            }
        }
        System.out.println();
        System.out.println("本次被选中的幸运同学是:"+arr[new Random().nextInt(arr.length)]);

    }
}